'use strict'
import React from 'react'
import style from '../css.css'
import List from './list'

class Swiper extends React.Component {
  constructor (props) {
    super(props)
    this.state = {}
  }

  _handleItem () {
    const { list } = this.props
    console.log(list)
    const array = [list[1], list[0], list[2]]
    console.log(array)
    const arr = array.map((item, index) => {
      return (
        <List item={item} index={index} key={index} />
      )
    })
    return arr
  }

  render () {
    const { nums } = this.props
    return (
      <div className={style.swipeKing}>
        <div
          className={nums == '1' ? style.swipeTitle1 : nums == '2' ? style.swipeTitle2 : nums == '3' ? style.swipeTitle3 : style.swipeTitle4}></div>
        <div className={style.kingWrap}>
          <div></div>
          {this._handleItem()}
          <div></div>
        </div>
      </div>
    )
  }
}

export default Swiper
